//
//  SucaiCollectionViewCell.m
//  WULIHH
//
//  Created by tang on 16/4/12.
//  Copyright © 2016年 tang. All rights reserved.
//

#import "SucaiCollectionViewCell.h"
#import "UIImageView+WebCache.h"
//#import "DownLoadViewController.h"
#import "Header.h"


@interface SucaiCollectionViewCell ()
{
    UIImageView *imageView;
    UILabel *titleLable;
    UIImageView *bottomView;
}

@end


@implementation SucaiCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
//        [self setBackgroundColor:[UIColor blueColor]];
        [self initUI];
    }
    return self;
}

- (void)initUI
{
    imageView = [[UIImageView alloc] initWithFrame:self.bounds];
//    [imageView setBackgroundColor:[UIColor redColor]];
    [imageView setOpaque:NO];
    [imageView.layer setCornerRadius:10.0];
    [imageView setContentMode:UIViewContentModeScaleToFill];
    [imageView.layer setMasksToBounds:YES];
    [self addSubview:imageView];
    
    
    UIImage *image = [UIImage imageNamed:@"yinying.png"];
    bottomView = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-image.size.height, self.bounds.size.width, image.size.height)];
    [bottomView setImage:image];
    [imageView addSubview:bottomView];
    
    titleLable = [[UILabel alloc] initWithFrame:CGRectMake(20, self.bounds.size.height-25, self.bounds.size.width, 22.0)];
    [titleLable setFont:[UIFont systemFontOfSize:14.5]];
    [titleLable setTextColor:[UIColor whiteColor]];
    
    [self addSubview:titleLable];
}




- (void)loadTypeInfo:(NSDictionary *)dic
{
    [imageView sd_setImageWithURL:[NSURL URLWithString:[dic valueForKey:@"imageUrl"]]];
    [titleLable setText:[[[dic valueForKey:@"tags"] objectAtIndex:0] valueForKey:@"name"]];
    
}


@end
